﻿@{
    ViewBag.Title = "AscriptionEdit";
}
@using CRM.Admin.Areas.Customer.Controllers
@using CRM.Admin.Contracts.Dto.Sys

@model CRM.Admin.Contracts.Dto.Customer.AscriptionDto
@section head
{
    <link href="@Url.Content("~/ScriptPlugin/easyui/themes/gray/easyui.css")" rel="stylesheet" />
    <link href="@Url.Content("~/ScriptPlugin/easyui/themes/icon.css")" rel="stylesheet" />
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/easyui/jquery.easyui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/easyui/locale/easyui-lang-zh_CN.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/KingsSharp.DataGrid.Filter.js")"></script>
    <script src="@Url.Content("~/ScriptPlugin/WdatePicker/js/WdatePicker.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/form2json.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.extended.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/picdata.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.linq.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/webuploader/webuploader.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/KingsSharp.Uploader.js")"></script>
    <style type="text/css">
        .uploader {
            text-align: center;
            float: left;
            width: 50px;
            height: 32px;
            line-height: 32px;
            color: blue;
        }

        .uploader-show {
            float: left;
            width: 70%;
            line-height: 32px;
        }

            .uploader-show a {
                margin-right: 5px;
                color: green;
            }

            .uploader-show img {
                width: 100%;
                height: 32px;
            }

                .uploader-show img.mulit {
                    width: 32px;
                    height: 32px;
                    padding-right: 5px;
                }
    </style>

}
<form action="" id="AscriptionEditform">
    <div class="content-form" id="content-form">
        <table class="content-table">
            <tr>
                <th><span>所属机构</span></th>
                <td>
                    <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                    <input type="hidden" id="CustomerId" name="CustomerId" value="@Model.CustomerId" />
                    <input type="text" id="OrganizationName" name="OrganizationName" value="@Model.OrganizationName" class="p-icon-right p-icon-catalog" readonly="true" onclick="getOrganization()" />
                    <input type="hidden" id="OrganizationId" name="OrganizationId" value="@Model.OrganizationId" />
                </td>

                <th><span>顾客代表</span></th>
                <td>
                    <input type="text" id="DeputyName" name="DeputyName" value="@Model.DeputyName" />
                </td>
            </tr>
         
        </table>
    </div>
</form>
@section foot
{
    <script type="text/javascript">
        function getOrganization() {

            K.layer.iframe({
                title: "机构选择",
                initfull: false,
                content: "@Url.Content("~/Sys/Organization/OrganizationTree")",
            area: ["360px", "335px"],
            callback: function (node) {
                $("#OrganizationName").val(node.name);
                $("#OrganizationId").val(node.id);
            }
        });
        }

        function SaveData(index) {
            if ($("#AscriptionEditform").valid()) {
                var dto = $("#AscriptionEditform").serializeArray();
                K.AjaxJson("@Url.Content("~/Customer/Ascription/AscriptionUpdate")", dto, function (result) {
                    parent.K.layer.callback(index, result, dto);
                    parent.K.layer.close(index);
                });
            }
        }
    </script>

}